<?
    //define ("DEBUG",true);
    include('includes/common.php');

    $item_id   =   POSTGET("item",0);

    ob_start();
    echo($item_id."<br/>");
    if($item_id<>0){
        $item   =   new ItemBO();
        $item->id   =   $item_id;
        $item->Load(0,1);
        if($item->Next()){
            echo($item->title."<br/>");
            echo("Adult: $".$item->adult_price." Child: $".$item->child_price."<br/>");

            if($item->article<>0){
                $article        =   new ArticleBO();
                $article->id    =   $item->article;
                $article->Load(0,1);
                if($article->Next()){
                    echo("<br/>start<br/>");
                    echo article_prepare_to_display($article->content);
                    echo("<br/>end<br/>");
                }
            }

            echo("br/".$item->information."<br/>");
            if($item->information<>0){
                echo("<br/>information<br/>");
                $page = new PageBO();
                $page->id = $item->information;
                $page->visible = 1;
                $page->Load(0,0);

                    if($page->code == "POIP")
                    {
                        include_once('zamena_poip.php');
                    }else
                    {
                        include_once('zamena.php');
                    }

                if($page->Next()){
                    $assign  = new AssignBO();
                    $assign->pageID = $page->id;
                    $assign->Load(0,0,array($assign->fields["position"] => "0"));
                    $count = $assign->getCount();
                    while($assign->Next())
                    {
                        $art_info   =   new ArticleBO();
                        $art_info->id   =   $assign->articleID;
                        $art_info->Load(0,0);

                        if($art_info->Next()){
                            echo article_prepare_to_display($art_info->content);
                        }
                        //$ARTICLE_ID = $assign->articleID;
                        //include('includes/showarticle.php');
                        ?>
                        <br/>-------------------------------------<br/>
                        <?
                        $articles_count++;
                    }//while

                }
            }//information


        }
    }

	// $main_content = ob_get_level().ob_get_contents();;
	$MAIN_BUFFER_CONTENT = ob_get_contents();
	ob_end_clean();
	require_once(SKIN_PATH.'layout_main.php');
?>